package com.egao.common.module.system.entity;

import com.baomidou.mybatisplus.annotation.*;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.constraints.NotBlank;
import java.io.Serializable;
import java.util.Date;
import java.util.List;

/**
 * 字典
 * @author lym
 */
@ApiModel(description = "字典")
@TableName("sys_dict")
@Data
public class Dict implements Serializable {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty("主键")
    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;

    @ApiModelProperty("字典类型")
    @NotBlank(message = "字典类型不为空")
    private String type;

    @ApiModelProperty("字典值")
    @NotBlank(message = "字典值不为空")
    private String value;

    @ApiModelProperty("字典标签")
    @NotBlank(message = "字典标签不为空")
    private String label;

    @ApiModelProperty("字典描述")
    @NotBlank(message = "字典描述不为空")
    private String description;

    @ApiModelProperty("字典排序 升序")
    private Integer sort;

    @ApiModelProperty("添加时间")
    private Date createTime;

    @ApiModelProperty("编辑时间")
    private Date updateTime;

    @ApiModelProperty("逻辑删除 0正常 1删除")
    @TableLogic
    private Integer deleted;

    @ApiModelProperty("父类id")
    private Integer parentId;

    @ApiModelProperty("子类")
    @TableField(exist = false)
    private List<Dict> children;

    @ApiModelProperty("是否禁用")
    @TableField(exist = false)
    private boolean disabled = false;
}
